<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="分类名称" prop="typeName">
        <el-input
          v-model="queryParams.typeName"
          placeholder="请输入分类名称"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="标签名称" prop="tagName">
        <el-input
          v-model="queryParams.tagName"
          placeholder="请输入标签名称"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="文章标题" prop="title">
        <el-input
          v-model="queryParams.title"
          placeholder="请输入文章标题"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
<!--      <el-form-item label="阅读次数" prop="readNum">-->
<!--        <el-input-->
<!--          v-model="queryParams.readNum"-->
<!--          placeholder="请输入阅读次数"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
      <el-form-item label="发布时间" prop="publishTime">
        <el-date-picker clearable size="small"
          v-model="queryParams.publishTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="选择发布时间">
        </el-date-picker>
      </el-form-item>
<!--      <el-form-item label="出现次数" prop="showNum">-->
<!--        <el-input-->
<!--          v-model="queryParams.showNum"-->
<!--          placeholder="请输入出现次数"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="唯一随机码" prop="randomCode">-->
<!--        <el-input-->
<!--          v-model="queryParams.randomCode"-->
<!--          placeholder="请输入唯一随机码"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="地理位置" prop="location">-->
<!--        <el-input-->
<!--          v-model="queryParams.location"-->
<!--          placeholder="请输入地理位置"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="阅读次数" prop="exReadNum">-->
<!--        <el-input-->
<!--          v-model="queryParams.exReadNum"-->
<!--          placeholder="请输入阅读次数"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="文章关键词" prop="exKeyword">-->
<!--        <el-input-->
<!--          v-model="queryParams.exKeyword"-->
<!--          placeholder="请输入文章关键词"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="发布渠道1：不发布，2：发布赚钱树，3：发布百度小程序，4：全部平台发布, 5: 百度小程序置顶" prop="exSource">-->
<!--        <el-input-->
<!--          v-model="queryParams.exSource"-->
<!--          placeholder="请输入发布渠道1：不发布，2：发布赚钱树，3：发布百度小程序，4：全部平台发布, 5: 百度小程序置顶"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="审核状态" prop="checkStatus">-->
<!--        <el-select clearable v-model="queryParams.checkStatus" placeholder="请选择审核状态" clearable size="small">-->
<!--          <el-option label="请选择字典生成" value="" />-->
<!--        </el-select>-->
<!--      </el-form-item>-->
<!--      <el-form-item label="文章真实点击量" prop="realClickNum">-->
<!--        <el-input-->
<!--          v-model="queryParams.realClickNum"-->
<!--          placeholder="请输入文章真实点击量"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="文章置顶" prop="topStatus">-->
<!--        <el-select clearable v-model="queryParams.topStatus" placeholder="请选择文章置顶" clearable size="small">-->
<!--          <el-option label="请选择字典生成" value="" />-->
<!--        </el-select>-->
<!--      </el-form-item>-->
<!--      <el-form-item label="内容" prop="extend2">-->
<!--        <el-input-->
<!--          v-model="queryParams.extend2"-->
<!--          placeholder="请输入内容"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
      <el-form-item label="作者" prop="extend3">
        <el-input
          v-model="queryParams.extend3"
          placeholder="请输入作者"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['business:article:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['business:article:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['business:article:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['business:article:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="articleList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="文章编号" align="center" prop="id" v-if="false"/>
      <el-table-column label="文章标题" align="center" prop="title" width="200"/>
      <el-table-column label="文章编号" align="center" prop="typeId"
                       :formatter="typeFormat"/>
      <el-table-column label="分类名称" align="center" prop="typeName" />

      <el-table-column label="标签名称" align="center" prop="tagName" width="200"/>
      <el-table-column label="文章内容" align="center" prop="extend2"  width="200"
                       show-overflow-tooltip/>
      <el-table-column label="文章图片url" align="center" prop="image" >
        <template scope="scope">
          　　　　<img  :src="scope.row.image" width="60" height="60"
                    class="head_pic"/>
          　　</template>
      </el-table-column>
      <el-table-column label="发布时间" align="center" prop="publishTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.publishTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
<!--      <el-table-column label="备注(活域名)" align="center" prop="remark" />-->
<!--      <el-table-column label="出现次数" align="center" prop="showNum" />-->
<!--      <el-table-column label="唯一随机码" align="center" prop="randomCode" />-->
<!--      <el-table-column label="地理位置" align="center" prop="location" />-->
<!--      <el-table-column label="阅读次数" align="center" prop="exReadNum" />-->
<!--      <el-table-column label="文章关键词" align="center" prop="exKeyword" />-->
<!--      <el-table-column label="发布渠道1：不发布，2：发布赚钱树，3：发布百度小程序，4：全部平台发布, 5: 百度小程序置顶" align="center" prop="exSource" />-->
<!--      <el-table-column label="审核状态" align="center" prop="checkStatus" />-->
<!--      <el-table-column label="文章真实点击量" align="center" prop="realClickNum" />-->
<!--      <el-table-column label="文章置顶" align="center" prop="topStatus" />-->
<!--      <el-table-column label="内容" align="center" prop="extend2" />-->
      <el-table-column label="作者" align="center" prop="extend3" width="200"/>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['business:article:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['business:article:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改文章对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="1200px"
               append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="文章类别编号">
          <el-select
            v-model="form.typeId"
            placeholder="文章类别编号"
            clearable
            size="small"
            style="width: 240px"
          >
            <el-option
              v-for="dict in typeOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="分类名称" :required="isHaveTo">
<!--          <el-input v-model="form.typeName" placeholder="请输入分类名称" />-->
          <el-select
            v-model="form.typeName"
            placeholder="文章类别编号"
            clearable
            size="small"
            style="width: 240px"
          >
            <el-option
              v-for="dict in typeSOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="标签名称" >
<!--          <el-input v-model="form.tagName" placeholder="请输入标签名称" />-->
          <el-select
            v-model="form.tagName"
            placeholder="标签名称"
            clearable
            size="small"
            style="width: 240px"
          >
            <el-option
              v-for="dict in tagOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="用户编号" prop="userId">
          <el-input v-model="form.userId" placeholder="请输入用户编号(复制党员信息用户编号)" />
        </el-form-item>
        <el-form-item label="文章图片url" prop="image">
          <el-input v-model="form.image" placeholder="请输入文章图片url" />
        </el-form-item>
        <el-form-item label="文章标题" prop="title">
          <el-input v-model="form.title" placeholder="请输入文章标题" />
        </el-form-item>
<!--        <el-form-item label="阅读次数" prop="readNum">-->
<!--          <el-input v-model="form.readNum" placeholder="请输入阅读次数" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="累计收益" prop="incomeNum">-->
<!--          <el-input v-model="form.incomeNum" placeholder="请输入累计收益" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="删除状态" prop="delFlag">-->
<!--          <el-input v-model="form.delFlag" placeholder="请输入删除状态" />-->
<!--        </el-form-item>-->
        <el-form-item label="发布时间" prop="publishTime">
          <el-date-picker clearable size="small"
            v-model="form.publishTime"
            type="datetime"
            value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="选择发布时间">
          </el-date-picker>
        </el-form-item>
<!--        <el-form-item label="备注(活域名)" prop="remark">-->
<!--          <el-input v-model="form.remark" placeholder="请输入备注(活域名)" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="出现次数" prop="showNum">-->
<!--          <el-input v-model="form.showNum" placeholder="请输入出现次数" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="唯一随机码" prop="randomCode">-->
<!--          <el-input v-model="form.randomCode" placeholder="请输入唯一随机码" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="地理位置" prop="location">-->
<!--          <el-input v-model="form.location" placeholder="请输入地理位置" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="阅读次数" prop="exReadNum">-->
<!--          <el-input v-model="form.exReadNum" placeholder="请输入阅读次数" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="文章关键词" prop="exKeyword">-->
<!--          <el-input v-model="form.exKeyword" placeholder="请输入文章关键词" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="发布渠道1：不发布，2：发布赚钱树，3：发布百度小程序，4：全部平台发布, 5: 百度小程序置顶" prop="exSource">-->
<!--          <el-input v-model="form.exSource" placeholder="请输入发布渠道1：不发布，2：发布赚钱树，3：发布百度小程序，4：全部平台发布, 5: 百度小程序置顶" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="审核状态">-->
<!--          <el-radio-group v-model="form.checkStatus">-->
<!--            <el-radio label="1">请选择字典生成</el-radio>-->
<!--          </el-radio-group>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="文章真实点击量" prop="realClickNum">-->
<!--          <el-input v-model="form.realClickNum" placeholder="请输入文章真实点击量" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="文章置顶">-->
<!--          <el-radio-group v-model="form.topStatus">-->
<!--            <el-radio label="1">请选择字典生成</el-radio>-->
<!--          </el-radio-group>-->
<!--        </el-form-item>-->
        <el-form-item label="内容" prop="extend2">

<!--          <div class="home">-->
<!--            <div id="div1"></div>-->

<!--            <textarea name="" id="text1" cols="100" rows="20"-->
<!--                      v-model="form.extend2"></textarea>-->
            <editor v-model="form.extend2" :min-height="500" uploadUrl="/dev-api/common/upload"/>

<!--          </div>-->

        </el-form-item>
        <el-form-item label="作者" prop="extend3">
          <el-input v-model="form.extend3" placeholder="请输入作者" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>

</template>

<script >
import { listArticle, getArticle, delArticle, addArticle, updateArticle, exportArticle } from "@/api/business/article";
import Editor from '@/components/Editor';

let el;
let tableBodyWrapDom;
let tableBodyDom;

function handle() {
  if (!el) return;
  // top为dom上侧距离可视窗口顶部的值
  let { top: tableBodyDomTop } = tableBodyWrapDom.getBoundingClientRect();  
  //console.log("aaaaaaaaaaaaaaaaaa="+tableBodyDomTop);
  if (tableBodyDomTop > window.innerHeight || tableBodyWrapDom.classList.contains('is-scrolling-none')) {
    // 此时列表在可视窗口的下侧不可见区域，因此不做任何修改
    tableBodyWrapDom.style.height = 'unset'
    tableBodyWrapDom.style.marginBottom = 'unset';
  } else {
    // 窗口高度 - 列表距顶部值 且 不超过自身实际值
    let wrapHeight = Math.min(window.innerHeight - tableBodyDomTop, tableBodyDom.offsetHeight);
    //console.log("bbbbbbbbbbbbbbb="+wrapHeight+"+"+tableBodyDom.offsetHeight);
    tableBodyWrapDom.style.height = wrapHeight + 'px';
    // 需要用marginBottom填充，以保持列表原有高度，避免页面的纵向滚动条变化导致页面滚动的不流畅
    // 可以通过注释这一行代码观察其效果差异
    tableBodyWrapDom.style.marginBottom = (tableBodyDom.offsetHeight - wrapHeight) + 'px';
  }
}


export default {
  name: "Article",
  components: { Editor
  },
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 文章表格数据
      articleList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      editor: null,
      editorData: '',
      editorContent: '',
      typeOptions: [],
      typeSOptions: [],
      tagOptions: [],

      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        typeName: undefined,
        tagName: undefined,
        title: undefined,
        readNum: undefined,
        publishTime: undefined,
        showNum: undefined,
        randomCode: undefined,
        location: undefined,
        exReadNum: undefined,
        exKeyword: undefined,
        exSource: undefined,
        checkStatus: undefined,
        realClickNum: undefined,
        topStatus: undefined,
        extend2: undefined,
        extend3: undefined
      },

      // 表单参数
      form: {},
      // 表单校验
      rules: {

        typeName: [
          { validator: validateName }
        ]
        ,
        image: [
          {
            required: true,
            message: "请输入文章图片",
            trigger: "blur"
          }
        ]
        ,
        title: [
          {
            required: true,
            message: "请输入文章标题",
            trigger: "blur"
          }
        ]
        ,
        publishTime: [
          {
            required: true,
            message: "请输入发布时间",
            trigger: "blur"
          }
        ]
        ,
        extend2: [
          {
            required: true,
            message: "请输入内容",
            trigger: "blur"
          }
        ]
      }
    };
    let validateName = (rule, value, callback) => {
      // 当活动名称为空值且为必填时，抛出错误，反之通过校验
      if (this.form.typeName === "" || this.isHaveTo) {
        callback(new Error("请输入分类名称"));
      } else {
        callback();
      }
    };
  },
  computed: {
    isHaveTo: function() {
      return this.form.typeName == `undefined`;
    }
  },
mounted() {
  // const editor = new E('#demo1')
  // const $text1 = $('#text1')
  // editor.config.onchange = function (html) {
  //   // 第二步，监控变化，同步更新到 textarea
  //   $text1.val(html)
  // }
  // editor.create()
  //
  // // 第一步，初始化 textarea 的值
  // $text1.val(editor.txt.html())

    el = this.$el; // 当前组件的Dom对象，避免操作到本组件之外的Dom
    tableBodyWrapDom = el.querySelector('.el-table__body-wrapper');
    tableBodyDom = el.querySelector('.el-table__body');
    // 监听事件
    document.addEventListener('scroll', handle,true);
    window.addEventListener('resize', handle,true);


  var editor = new E("#div1");

  editor.config.customAlert = function (str, code, err) {
    console.log("customAlert", str, code, err);
    alert(`str:${str}, code:${code}, err: ${err}`);
  };

  editor.config.linkCheck = () => {
    return false;
  };

  editor.create();

},destroyed() {//console.log("destroyed...............")
  	// 在组件销毁时取消监听
    document.removeEventListener('scroll', handle,true);
    window.removeEventListener('resize', handle,true);
  },
  activated() {//console.log("activated...............")
  el = this.$el; // 当前组件的Dom对象，避免操作到本组件之外的Dom
    tableBodyWrapDom = el.querySelector('.el-table__body-wrapper');
    tableBodyDom = el.querySelector('.el-table__body');
    // 全局绑定滚动事件，
    document.addEventListener('scroll', handle,true);
    window.addEventListener('resize', handle,true);
  },
  deactivated() {//console.log("deactivated...............")
    // 组件消失，解绑scroll事件
    document.removeEventListener('scroll', handle,true);
    window.removeEventListener('resize', handle,true);
  },
  created() {
    this.getList();
    this.getDicts("sys_article").then(response => {
      this.typeOptions = response.data;
    });
    this.getDicts("sys_article_name").then(response => {
      this.typeSOptions = response.data;
    });
    this.getDicts("sys_article_tag").then(response => {
      this.tagOptions = response.data;
    });
  },
  methods: {
    /** 查询文章列表 */
    getList() {
      this.loading = true;
      listArticle(this.queryParams).then(response => {
        this.articleList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    typeFormat(row, column) {
      if (row.menuType == "F") {
        return "";
      }
      return this.selectDictLabel(this.typeOptions, row.typeId);
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },

  beforeDestroy() {
    // 调用销毁 API 对当前编辑器实例进行销毁
    this.editor.destroy()
    this.editor = null
  },
    // 表单重置
    reset() {
      this.form = {
        id: undefined,
        typeId: undefined,
        typeName: undefined,
        tagName: undefined,
        content: undefined,
        contentUrl: undefined,
        userId: undefined,
        image: undefined,
        title: undefined,
        readNum: undefined,
        incomeNum: undefined,
        delFlag: undefined,
        createTime: undefined,
        updateTime: undefined,
        publishTime: undefined,
        remark: undefined,
        showNum: undefined,
        randomCode: undefined,
        location: undefined,
        exReadNum: undefined,
        exKeyword: undefined,
        exSource: undefined,
        checkStatus: 0,
        realClickNum: undefined,
        topStatus: 0,
        extend2: undefined,
        extend3: undefined
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加文章";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getArticle(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改文章";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          console.log("分类"+this.form.typeName)
          if (this.form.id != null) {
            updateArticle(this.form).then(response => {
              this.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addArticle(this.form).then(response => {
              this.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$confirm('是否确认删除文章编号为"' + ids + '"的数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return delArticle(ids);
        }).then(() => {
          this.getList();
          this.msgSuccess("删除成功");
        })
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams;
      this.$confirm('是否确认导出所有文章数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return exportArticle(queryParams);
        }).then(response => {
          this.download(response.msg);
        })
    }
  }
};

</script>

<style lang="scss">
  .home {
    width: 1200px;
    margin: auto;
    position: relative;
    .btn {
      position: absolute;
      right: 0;
      top: 0;
      padding: 5px 10px;
      cursor: pointer;
    }
    h3 {
      margin: 30px 0 15px;
    }
  }
  .toolbar {
    border: 1px solid #ccc;
  }
  .text {
    border: 1px solid #ccc;
    min-height: 300px;
  }
  .ovell span{
    display: block;
    width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: black;
  }
  .ovell span:hover{
    display: block;
    overflow: visible;
  }
</style>
